﻿using System;
using Genko.Model.Schema;

namespace Genko.Model
{
	public class SchemaSet : Member
	{
		protected internal SchemaSet(Scheme scheme)
		{
			this.owner = scheme;
		}

		protected override void Initialize(Member owner)
		{
			base.Initialize(owner);
			Attach(new BaseMetaModel(this));
		}

		public override bool CanBeAttached(Member member)
		{
			return (member is MetaModel);
		}

		[MemberActivator(SchemaTags.META_MODEL_TAG)]
		public virtual Member CreateMetaModel()
		{
			return new MetaModel(this);
		}

		public virtual MetaModel CreateMetaModel(string metaModelName)
		{
			MetaModel metaModel = new MetaModel(this, metaModelName);
			return metaModel;
		}

		public virtual Model CreateModel(string metaModelName)
		{
			return null;
		}
	}
}
